package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SecondClass generated by hbm2java
 */
@Entity
@Table(name = "second_class", catalog = "shop")
public class SecondClass implements java.io.Serializable {

	private Integer id;
	private FirstClass firstClass;
	private String className;
	private Set<ThirdClass> thirdClasses = new HashSet<ThirdClass>(0);

	public SecondClass() {
	}

	public SecondClass(FirstClass firstClass, String className,
			Set<ThirdClass> thirdClasses) {
		this.firstClass = firstClass;
		this.className = className;
		this.thirdClasses = thirdClasses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	public FirstClass getFirstClass() {
		return this.firstClass;
	}

	public void setFirstClass(FirstClass firstClass) {
		this.firstClass = firstClass;
	}

	@Column(name = "class_name", length = 50)
	public String getClassName() {
		return this.className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "secondClass")
	public Set<ThirdClass> getThirdClasses() {
		return this.thirdClasses;
	}

	public void setThirdClasses(Set<ThirdClass> thirdClasses) {
		this.thirdClasses = thirdClasses;
	}

}
